<template>
  <div>
    <el-dialog :visible.sync="visible" width="1200px" title="打印">
      <iframe :src="src" frameborder="0" class="print-wrapper" />
    </el-dialog>
  </div>
</template>

<script>

export default {
  data() {
    return {
      visible: false,
      src: ''
    }
  },
  created() {

  },
  methods: {
    show(formDataId, processInstanceId, taskId, file){
      const userInfo = this.$store.getters.userInfo
      const BASE_URL = process.env.VUE_APP_API_BASE_URL
      this.src = `${BASE_URL}/ureport/preview?_u=1:${file}&data_id=${formDataId}&pro_ins_id=${processInstanceId}&task_id=${taskId}&user_id=${userInfo.userId}`
      // console.log(this.src)
      // this.src = `${BASE_URL}/ureport/preview?_u=file:qjt.ureport.xml&data_id=&pro_ins_id=`
      this.visible = true
    }
  }
}
</script>
<style lang="scss" scoped>

  .print-wrapper {
    // height: calc(100vh - 100px);
    height: 600px;
    width: 1024px;
    overflow: auto;
    padding: 12px;
    box-sizing: border-box;
  }
</style>